<?
include_once("includes/header.php");
$datosClinicos = "";
$idPap = "0";
$tipoInforme = "";
$numeroProtocolo = "";
if (isset($_SESSION["idTipoInforme"]))
{
    $idTipoInforme = is_numeric($_SESSION["idTipoInforme"]) ? $_SESSION["idTipoInforme"] : 0;
    $link = OpenDB();
    $query = "select descripcion from tipo_informe where id_tipo_informe =" . $idTipoInforme;
    $tipoInforme = GetSQLFirstValue($query);
}
if (isset($_SESSION["protocolo"]))
{
    $numeroProtocolo = $_SESSION["protocolo"];
}

$titulo = "Datos Cl&iacute;nicos";

include('menu.php');
if (isset($_SESSION["protocolo"]))
{
    if (is_numeric($_SESSION["protocolo"]))
    {
        $protocolo = $_SESSION["protocolo"];
        $query = "select id_pap, datos_clinicos from pap where numero_protocolo = " . $protocolo;
        $pap = GetSQL($query);
        $idPap = $pap[0]["id_pap"] != "" ? $pap[0]["id_pap"] : 0;
        $datosClinicos = $pap[0]["datos_clinicos"];
    }
}
?>
<script type="text/javascript">
    $(function(){
        $(".step").hide();
        $(".saveButton").live("click", function(event){
            $("#formPap").submit();
            event.preventDefault();
        });
    });
</script>
</head>
<body>
    <br/>
    <div class="textTemplateBody">  
        <form id="formPap" action="guardarDatosClinicos.php" method="post">
                <textarea cols="30" rows="5" id="datos_clinicos" name="datos_clinicos"><?= $datosClinicos ?></textarea>
                <input type="hidden" name="idPap" id="idPap" value="<?= $idPap ?>" />
                <div><a href='#' class='saveButton'><img alt='guardar' title='Guardar' src='imagenes/guardar.png'/></a></div>
        </form>
    </div>
</body>
</html>